# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer: Grigory Kirillov <txgk@bk.ru>
pkgname=libcyaml
pkgver=1.3.1
pkgrel=0
pkgdesc="C library for reading and writing YAML"
url="https://github.com/tlsa/libcyaml"
arch="all"
license="ISC"
makedepends="yaml-dev"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://github.com/tlsa/libcyaml/archive/v$pkgver/libcyaml-v$pkgver.tar.gz"

build() {
	make VARIANT=release
}

check() {
	make test
}

package() {
	make PREFIX=/usr DESTDIR="$pkgdir" install
	install -Dm644 docs/guide.md -t "$pkgdir"/usr/share/doc/"$pkgname"/
	install -Dm644 examples/numerical/* -t "$pkgdir"/usr/share/doc/"$pkgname"/examples/numerical/
	install -Dm644 examples/planner/* -t "$pkgdir"/usr/share/doc/"$pkgname"/examples/planner/
	install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/"$pkgname"/
}

sha512sums="
2daa380e579836aae78d442323ca4a13125ba0ac7be2a0ad9fc79d05b5b3c14a4c5041ee50c5c28ed71793d7748e50d68ac3c65cf856afe2614d098ad62b6e88  libcyaml-v1.3.1.tar.gz
"
